<?php
    apf_require_class("PageHelper");
    $img_path = '/img/home/';
    ?>

<div class="header">
    <div class="bg_top"></div>
    <div class="logo"></div>
</div>
<div class="container">
    <h1>招聘需求申请</h1>
    <form id="form1" action="" method="post">
    <input type="hidden" name="flow_id" value="<?=$data['flow_id']?>">
        <hr/>
        <ul>
            <li>
                <label>部门：</label><span><?=$depdata['city_name'].$depdata['bu_name'].$depdata['department_name']?></span><br/>
                <label>职位名称<em>*</em>：</label><input class="position" name="job_name" value="<?=htmlspecialchars($def_data['job_name'])?>"/>
                <input type="hidden" name="job_id" class="job_id" value="<?=$def_data['job_id']?>" />
                <input type="hidden" class="city_id" name="city_id" value="<?=$def_data['work_city_id']?>" />

                （计划编制：<span class="plan_num"><?php echo empty($def_out_data['pnum']) ? 0 :$def_out_data['pnum']; ?></span>人&nbsp;&nbsp;&nbsp;&nbsp;在编：<span class="act_num"><?php echo empty($def_out_data['fnum']) ? 0 :$def_out_data['fnum']; ?></span>人<span class="hid_flow" >申请中：<em>0</em>人</span>)<br/>
                <?php
                $job_needs = '';
                if(!empty($def_data['job_needs'])){
                    $job_needs = $def_data['job_needs'];
                }
                ?>
                <label>需求人数<em>*</em>：</label><input type="text" class="per" name="job_needs" value="<?=$job_needs?>" />(编制内：<input disabled="true" style="width: 40px;height: 17px;" type="text" name="plan_num1" value="<?=$def_data['plan_num']?>" />&nbsp;&nbsp;编制外：<input disabled="true" style="width: 40px;height: 17px;" type="text" name="out_plan_num1" value="<?=$def_data['out_plan_num']?>" />)
                <input type="hidden" name="plan_num" value="<?=$def_data['plan_num']?>" />
                <input type="hidden" name="out_plan_num" value="<?=$def_data['out_plan_num']?>" />
                <label class="tip">温馨提示：编制外的需求申请，需要CEO审批</label><br/>
                <label>员工类型<em>*</em>：</label><select style="width: 100px;" name="user_type">
                    <?php foreach($data['user_type'] as $val):?>
                    <option value="<?=$val['type_id']?>" <?php if($val['type_id']==$def_data['user_type']):?>selected="selected"<?php endif;?>><?=$val['type_name']?></option>
                    <?php endforeach;?>
                </select><br/>
                <?php
                $is_pm_1 = 'checked="checked"';
                $is_pm_2 = '';
                if(!empty($def_data['is_p_m']) && $def_data['is_p_m']==2){
                    $is_pm_2 = 'checked="checked"';
                    $is_pm_1 = '';
                }
                ?>
                <label>职级范围<em>*</em>：</label><input type="radio" value="1" name="is_p_m" <?=$is_pm_1?> />P级
                <select style="width: 50px;" name="p_start">
                    <?php if(!empty($data['pm']['p_list'])):?>
                    <?php foreach($data['pm']['p_list'] as $k=>$val):?>
                    <option value="<?=$k?>" <?php if($k==$def_data['p_start']):?>selected="selected"<?php endif;?>><?=$val?></option>
                    <?php endforeach;?>
                    <?php endif;?>
                </select>
                -
                <select style="width: 50px;" name="p_end">
                    <?php if(!empty($data['pm']['p_list'])):?>
                    <?php foreach($data['pm']['p_list'] as $k=>$val):?>
                    <option value="<?=$k?>" <?php if($k==$def_data['p_end']):?>selected="selected"<?php endif;?>><?=$val?></option>
                    <?php endforeach;?>
                    <?php endif;?>
                </select><br/>

                <label></label><input  type="radio" value="2" name="is_p_m" <?=$is_pm_2?> />M级
                <select style="width: 50px;" name="m_start">
                    <?php if(!empty($data['pm']['m_list'])):?>
                    <?php foreach($data['pm']['m_list'] as $k=>$val):?>
                    <option value="<?=$k?>" <?php if($k==$def_data['m_start']):?>selected="selected"<?php endif;?>><?=$val?></option>
                    <?php endforeach;?>
                    <?php endif;?>
                </select>
                -
                <select style="width: 50px;" name="m_end">
                    <?php if(!empty($data['pm']['m_list'])):?>
                    <?php foreach($data['pm']['m_list'] as $k=>$val):?>
                    <option value="<?=$k?>" <?php if($k==$def_data['m_end']):?>selected="selected"<?php endif;?>><?=$val?></option>
                    <?php endforeach;?>
                    <?php endif;?>
                </select>

                <br/>
                <label>申请原因<em>*</em>：</label><textarea rows="5" cols="5" style="vertical-align: top;margin:15px 0px;width: 393px;height: 50px;" name="apply_reason"><?=$def_data['apply_reason']?></textarea>
                <br/>
                <label>工作地点<em>*</em>：</label><select style="width: 400px;" name="work_address">
                    <?php foreach($data['office_address'] as $k=>$val):?>
                    <option value="<?=$k?>" <?php if($k==$def_data['work_address']):?>selected="selected"<?php endif;?>><?=$val?></option>
                    <?php endforeach;?>
                </select>

                <h2>申请信息</h2>
                <hr/>

            </li>

            <li class="ability">

                <i style="display: block;"><label>核心能力<em>*</em>：</label><span style="display: inline-block;width: 200px" class="tipAbility">亲您最多可选择三项!</span></i>
                <label style="height: 1px;margin: 0"></label>
                <?php $work_core = array();
                 if(!empty($def_data['work_core'])){
                    $work_core = explode(',', $def_data['work_core']);
                 }
                ?>
                <?php foreach($data['work_core_list'] as $k=>$val):?>
                <span><input type="checkbox" name="work_core[]" value="<?=$k?>" <?php if(in_array($k,$work_core)):?>checked<?php endif;?> /><?=$val?></span>
                <?php if($k==5 || $k==10):?>
                <br/><label style="height: 1px;"></label>
                <?php endif;?>
                <?php endforeach;?>


                <label>专业能力<em>*</em>：</label><textarea rows="5" cols="5" style="vertical-align: top;margin:15px 0px;width: 400px;height: 50px;" name="work_special"><?=$def_data['work_special']?></textarea>
                <h2>能力要求</h2>
                <hr/>
            </li>

            <li>
                <label>工作职责<em>*</em>：</label><textarea rows="5" cols="5" style="vertical-align: top;margin:15px 0px;width: 400px;height: 50px;" name="work_plus"><?=$def_data['work_plus']?></textarea><br/>
                <label>岗位要求<em>*</em>：</label><textarea rows="5" cols="5" style="vertical-align: top;margin-bottom:15px;width: 400px;height: 50px;" name="work_skilled"><?=$def_data['work_skilled']?></textarea>
                <h2>岗位描述</h2>
                <hr/>
            </li>
            <?php
                $is_rw_2 = 'checked="checked"';
                $is_rw_1 = '';
                $is_rw_s = 'display:none';
                if(!empty($def_data['is_written']) && $def_data['is_written']==1){
                    $is_rw_1 = 'checked="checked"';
                    $is_rw_2 = '';
                    $is_rw_s = '';
                }
                ?>
            <li>
                <label>笔试<em>*</em>：</label><input type="radio" name="is_written" value="1" <?=$is_rw_1?> />需要&nbsp;&nbsp;<input type="radio" name="is_written" value="2" <?=$is_rw_2?> />不需要<br/>
                <p class="examinationBlock" style="<?=$is_rw_s?>"><label>试卷编号<em>*</em>：</label><input style="width: 280px;" type="text" name="written_info" value="<?=htmlspecialchars($def_data['written_info'])?>" /></p>
                <h2>考核要求</h2>

            </li>


         </ul>
            <input type="submit" class="submit" value=""/>
    </form>
    </div>
<div class="footer">
</div>
    <?php $this->script_block_begin(); ?>
<script type="text/javascript">
var num_url = "<?=Flow_Urls::ajax_flow_job();?>";
var url_job = "<?php echo Portal_Urls::ajax_recruit_search_job();?>";
var address_list = '<?=$data['office_address_list']?>';

</script>
    <?php $this->script_block_end(); ?>